'use strict';

module.exports = () => {
  return async (ctx, next) => {
    ctx.service.socket.date.createTimer(() => {
      ctx.socket.emit('date', new Date());
      // const nsp = app.io.of('/');
      // const query = socket.handshake.query;
    });
    await next();
    ctx.service.socket.date.clearTimer();
    console.log('断开连接');
  };
};

